package com.winter.Controller;

import com.winter.model.AreaCode;
import com.winter.service.AreaService;
import com.winter.util.Result;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("v1/area")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @GetMapping
    public Result List(Integer type, Long superId) {
        List<AreaCode> list = areaService.list(type, superId);
        return Result.success(list);
    }
}
